package com.sh.rbac.core.sensitive.annotation;

import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.sh.rbac.core.sensitive.enums.SensitiveStrategy;
import com.sh.rbac.core.sensitive.handler.SensitiveHandler;

import java.lang.annotation.*;

/**
 * 敏感信息注解
 *
 * @author wb
 * @since 2025-11-06
 */

@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotationsInside
@JsonSerialize(using = SensitiveHandler.class)
public @interface Sensitive {

    /**
     * 脱敏策略
     */
    SensitiveStrategy strategy();

    /**
     * 角色标识
     */
    String[] roleKeys() default {};

    /**
     * 权限标识
     */
    String[] perms() default {};
}
